<?php
/*
 * Scan html
 */
class scan {
	static function twogames($url, $page = 0) {
		// Fake browser header
		$headers [] = 'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg';
		$headers [] = 'Connection: Keep-Alive';
		$headers [] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
		$userAgent = 'php';
		$process = curl_init ( $url );

		curl_setopt ( $process, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36' );
		curl_setopt ( $process, CURLOPT_HTTPHEADER, $headers );
		curl_setopt ( $process, CURLOPT_HEADER, 0 );
		curl_setopt ( $process, CURLOPT_USERAGENT, $userAgent );
		curl_setopt ( $process, CURLOPT_TIMEOUT, 30 );
		curl_setopt ( $process, CURLOPT_RETURNTRANSFER, 1 );
		curl_setopt ( $process, CURLOPT_FOLLOWLOCATION, 1 );
		curl_setopt ( $process, CURLOPT_BINARYTRANSFER, 1 );
		curl_setopt ( $process, CURLOPT_SSL_VERIFYPEER, false );
		$data = curl_exec ( $process );

		// Get content
		$html = file_get_html ( $data );
// 		$html = file_get_contents($url);

		return $html;
	}
}